<template>
    <div>
        <p class="hint" v-if="!state"><i class="iconfont icon-shibai error-icon"></i>支付失败,请重新再试</p>
        <p class="hint" v-else><i class="iconfont icon-chenggong success-icon"></i>支付成功</p>
        <mt-button class="btn" @click="orderList">查看订单</mt-button>
    </div>
</template>
<script>
export default {
    data() {
        return {
            state:0
        }
    },
    created(){
        console.log(this.$route);
        this.state = parseInt(this.$route.query.state);
        if(!this.state){
            this.$store.commit('DEL_CART');
        }
    },
    methods:{
        orderList(){
            this.$router.push({path:'orderList'})
        }
    }
}
</script>
<style scoped>
    .hint {
        height: 5rem;
        font-size: 1.5rem;
        font-weight: bolder;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;

    }
    .hint .iconfont {
        font-size: 3rem;
        margin: 0 1rem;
    }
    .error-icon{
        color: red;
    }
    .success-icon{
        color:#02a774;
    }
    .btn {
        margin-left: 10%;
        height: 3rem;
        background: #F23D3D;
        color: #fff;
        font-size: 1rem;
    }
</style>